Skip to content

Conversation

@Dokujaa
Copy link
Contributor

@Dokujaa Dokujaa commented Jul 20, 2025

Sorry for the redundancy. Facing some issues with the old PR with merge conflicts when trying to merge to the vertex_support branch. I'll just try to merge into main this time.

PR includes Vertex AI support rebased on the latest async database refactor as requested.

lingtonglu and others added 3 commits July 20, 2025 16:44
- Add OAuth2 token caching functions to async_cache.py and cache.py
- Create async_oauth_token_cache with 55-minute TTL (5-min safety buffer)
- Update vertex_authentication method to check cache first before token refresh
- Add OAuth2 token cache statistics tracking
- Cache key format: token:{api_key}
- Performance optimization: reduce unnecessary token refresh calls
  * Replace fixed TTL with token's native expires_at timestamp validation
  * Use SHA-256 hashed cache keys for long JSON service account credentials
  * Add opportunistic cleanup to prevent expired token memory leaks
  * Standardize token structure with access_token, expires_at, token_type fields
  * Simplify Vertex AI authentication using service account re-authentication
  * Move imports to top-level for better code quality

  Addresses PR feedback on cache key security, TTL complexity, and memory management.
@lingtonglu
Copy link
Contributor

Sorry for the delay. We're doing some tests for the async db tests. Would rebase the original PR: #7 and merge it very soon. Then you could submit your PR based on that.

@Dokujaa Dokujaa closed this Jul 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants